# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-vfs-rar
pkgver=19.0.1
_realname=Matrix
pkgrel=0
pkgdesc="RAR VFS add-on for Kodi"
options="!check" # no test suite
url="https://github.com/xbmc/vfs.rar"
arch="x86 x86_64 aarch64 armv7" # kodi is available only on those arches
license="GPL-2.0-only"
makedepends="cmake kodi-dev"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/vfs.rar/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/vfs.rar-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a31017793333ebc548bfaaa25bd294e7fdd7c9c4c5ffed94e2d8ae7442221cc238bcb06e201ed506ca1b8f8520fc701fb211c340bcdaeb7b25e2e2c285812a83  kodi-vfs-rar-19.0.1-Matrix.tar.gz
"
